#计时功能版本1，采用面向过程的方式实现
#功能：运行某个函数，如：print_odd()或wait_while()，并记录函数运行的时间
import time
def print_odd(n):
    start = time.time()
    for i in range(n):
        if i%2==0:
            print(i,end=",")
    print("\n print_odd is over...")
    end = time.time()
    print("it takes {}s".format(end-start))

def wait_while(n1,n2,n3):
    start = time.time()
    time.sleep(n1+n2+n3)
    print("\nwait_while is over...")
    end = time.time()
    print("it takes {}s".format(end-start))

print_odd(2000)
wait_while(0.5, 0.4, 0.2)